﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Telerik.Web.UI;

namespace NWS.Games
{
	public partial class Cars : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			
		}
		protected void RadGrid_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
		{
			if (e.Exception != null)
			{
				e.KeepInEditMode = true;
				e.ExceptionHandled = true;
				DisplayMessage("Exception. Reason: " + e.Exception.ToString());
			}
		}

		protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
		{
			if (e.Exception != null)
			{
				e.ExceptionHandled = true;
				e.KeepInInsertMode = true;
				DisplayMessage("Exception. Reason: " + e.Exception.ToString());
			}
		}

		protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
		{
			if (e.Exception != null)
			{
				e.ExceptionHandled = true;
				DisplayMessage("Exception. Reason: " + e.Exception.ToString());
			}
		}

		private void DisplayMessage(string text)
		{
			RadGrid1.Controls.Add(new LiteralControl(text));
		}
	}
}
